package cn.com.yx.ms.persistence;

import cn.com.yx.ms.application.web.ApiQueryBase;
import cn.com.yx.ms.domain.dbmodel.SysRole;
import cn.com.yx.ms.domain.sys.FunBtnModel;
import cn.com.yx.ms.domain.sys.FunModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysRoleMapper {
    int deleteByPrimaryKey(String guid);

    int insert(SysRole record);

    int insertSelective(SysRole record);

    SysRole selectByPrimaryKey(String guid);

    int updateByPrimaryKeySelective(SysRole record);

    int updateByPrimaryKey(SysRole record);

    int deleteAllRolesByUserId(@Param("userid") String userid);

    int deleteAllUserRolesByRoleId(@Param("roleid") String roleid);

    int deleteFunsByRoleId(@Param("roleid") String roleid);

    int deleteNoMapRole();

    List<SysRole> find(ApiQueryBase query);

    int selectCountByRoleName(@Param("rolename") String rolename);

    List<FunModel> findAllFunsByRoleId(@Param("roleId") String roleId);

    List<FunModel> findFunsByUserId(@Param("userId") String userId);

    List<FunBtnModel> findOnlyBtnFunsByUserId(@Param("userId") String userId);

}